﻿{include file="common/header" /}
<article class="page-container">
	<form action="" method="post" class="form form-horizontal" id="myform">
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red"></span>CustName：</label>
			<div class="formControls col-xs-8 col-sm-9">
			        {{$customer->CustName}}
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red"></span>Driver：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<style>
					.driver-list{
						width: 200px;
						display: inline-block;
					}
				</style>
				{volist name="driver" id="vo"}
				<div class="driver-list">
					<input id="input_{{$key}}" class="" type="checkbox" name="frobidDriver[]" value="{{$vo.driver_id}}"    {if in_array($vo.driver_id,$forbidDriver)} checked {/if}>
					<label  for="input_{{$key}}">{{$vo.nickname}}</label>
				</div>
				{/volist}
			</div>
		</div>
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
				<input type="hidden" name="id" value="{{$customer->id}}">
				<button type="button" class="btn btn-success radius" id="save-btn" name="admin-role-save"><i class="icon-ok"></i> 确定</button>
			</div>
		</div>
	</form>
</article>
<script>
	$('#save-btn').click(function () {
        $.ajax({
            type: "POST",
            dataType: "json",
            url: "{{:url('/order/frobidDriver')}}" ,
            data: $('#myform').serialize(),
            success: function (result) {
                if (result.code == 200) {
                    layer.msg('保存成功!',{icon:1,time:1000},function (index) {
                    });
                }else{
                    layer.msg(result.msg,{icon:1,time:1000});
				}
            },
            error : function() {
                layer.msg('异常!',{icon:1,time:100000000});

            }
        });
    })
</script>
{include file="common/header" /}